home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6306 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.nstn.ca!news
  2. From: keichele@ac.dal.ca (Klaus Eichele)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help! C code under Win 3.11
  5. Date: Sat, 24 Feb 1996 01:34:09 GMT
  6. Organization: Dalhousie University
  7. Message-ID: <4glbu9$jlo@news.nstn.ca>
  8. References: <4gko20$oha@earth.alpha.net>
  9. NNTP-Posting-Host: rewasylishen.chem.dal.ca
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. sdg@earth.execpc.com (Software Development Group) wrote:
  13.  
  14. >Could someone please tell me why this C code is not working under
  15. >Windows 3.11.  It compiles, but does nothing.  
  16.  
  17. >The following code is main.c and there's another .c that has
  18. >a function that's called from here.
  19.  
  20. >Most importantly, I'd like some kind of print-handler working.
  21. >At least that way I can see what's going on.
  22.  
  23.    < SNIP about 50 lines of code>
  24.  
  25. >/* int*/
  26. >/* main(int argc, char **argv)*/
  27. >/* {*/
  28.  
  29. >WINAPI
  30. >WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
  31. >{
  32. > #define MAXCMDTOKENS 128
  33. > int argc = 0;
  34. > LPSTR argv[MAXCMDTOKENS];
  35.  
  36.    < SNIP several 100 lines of code>
  37.  
  38. Hi,
  39. The major problem here lies in the misconception that renaming main()
  40. into WinMain() creates a Windows 3.11 application. It is not quite as
  41. easy as that!!! The best reference is Charles Petzold's "Programming
  42. Windows 3.1" by Microsoft Press. There will be quite a bit of work
  43. involved to restructure your program into a well behaved Windows
  44. application.
  45. Otherwise, you might be better of by running your program in a DOS
  46. box.
  47.  
  48. Good Luck,
  49. Klaus
  50.  
  51. P.S. comp.lang.c is the completely wrong group for questions like
  52. this, and I am sure other people will point this out also. Try
  53. comp.os.ms-windows.programmers.misc and related groups.
  54.  
  55. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  56. Klaus Eichele         keichele@ac.dal.ca  
  57. http://ac.dal.ca/~keichele/keichele.html
  58.  
  59.